#ifndef _TD_SDLSOUND_H_
#define _TD_SDLSOUND_H_

/************************************************************************/
/* STL                                                                  */
/************************************************************************/
#include <string>

/************************************************************************/
/* SDL                                                                  */
/************************************************************************/
#include "SDL/SDL.h"
#include "SDL_mixer/SDL_mixer.h" 

/************************************************************************/
/* Resources                                                            */
/************************************************************************/
#include "Resources/Resource.h"

/**Using STD namespace.*/
using namespace std;


namespace TD_Resources {

	class SDLSound : public Resource {

		//Raw SDL image pointer
		Mix_Chunk *m_pSound;	
		int m_soundChannel;
		static bool m_mixerInitialized;

	public:

		/************************************************************************/
		/* Constructors				                                            */
		/************************************************************************/
		//Constructor default
		explicit SDLSound();

		//Copy constructor
		explicit SDLSound(const SDLSound &rhs);

		//Assignment constructor
		SDLSound & operator=(const SDLSound &rhs);

		//Initialization constructor
		explicit SDLSound(const string &resourceName);

		//Destructor 
		~SDLSound();

		/************************************************************************/
		/* Access functions                                                     */
		/************************************************************************/
		


		/************************************************************************/
		/* Functionalities                                                      */
		/************************************************************************/

		/**Loads a SDL_Surface from a file*/
		bool loadFile(const string &file);

		/**Plays the music loaded.*/
		void playSound(bool loopSound);

		/** Initializes the soundMixer */
		static void initSoundMixer();

		/************************************************************************/
		/* Rendering                                                            */
		/************************************************************************/

		virtual void render(SDL_Surface *g_destSurface, unsigned int deltaTime);
	};
}
#endif